00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef DERENDERSTATES_PRIV_HPP
00029 #define DERENDERSTATES_PRIV_HPP
00030
00031 #include "deRenderStates.hpp"
00032 #include "deFile.hpp"
00033 #include "deWorld_Helper.hpp"
00034
00035 class deRenderState : public deWorldObject, virtual public IdeRenderState
00036 {
00037 protected:
00038 deRenderState();
00039 virtual ~deRenderState();
00040 deBoolean Lock();
00041 deBoolean Unlock();
00042 void* GetWOInterface(long interface_id);
00043 long m_LockFlag;
00044 };
00045
00046
00047 class deRenderTexture : public deRenderState, public IdeRenderTexture
00048 {
00049
00050 protected:
00051 ~deRenderTexture();
00052 public:
00053 deRenderTexture();
00054
00055 #if defined(DESTINY3D_STATIC_LINK)
00056 friend deBoolean IdeRenderState_SetDefaultTextureFilters(long MinFilter, long MagFilter, long MipFilter, deBoolean EnableMip);
00057 #else
00058 friend __declspec(dllexport) deBoolean IdeRenderState_SetDefaultTextureFilters(long MinFilter, long MagFilter, long MipFilter, deBoolean EnableMip);
00059 #endif
00060 IdeRenderState::Type GetRSType() const;
00061 void * GetRSInterface(IdeRenderState::Type type) const;
00062 WorldObjectClassDef;
00063 deBoolean DeSerializeLoad();
00064
00065
00066 deBoolean SetColorOperation(long Stage, TextureOp ColorOp);
00067 deBoolean SetAlphaOperation(long Stage, TextureOp AlphaOp);
00068 TextureOp GetColorOperation(long Stage) const;
00069 TextureOp GetAlphaOperation(long Stage) const;
00070 deBoolean SetResultTarget(long Stage, TextureArg Target);
00071 TextureArg GetResultTarget(long Stage);
00072
00073
00074 deBoolean SetColorArg(long Stage, long ArgNum, TextureArg Arg);
00075 deBoolean SetAlphaArg(long Stage, long ArgNum, TextureArg Arg);
00076 TextureArg GetColorArg(long Stage, long ArgNum) const;
00077 TextureArg GetAlphaArg(long Stage, long ArgNum) const;
00078
00079
00080 deBoolean SetBitmap(long Stage, IdeBitmapProxy* Bitmap);
00081 IdeBitmapProxy*GetBitmap(long Stage) const;
00082
00083
00084 deBoolean SetTextureAddressU(long Stage, TextureAddress Address);
00085 deBoolean SetTextureAddressV(long Stage, TextureAddress Address);
00086 TextureAddress GetTextureAddressU(long Stage) const;
00087 TextureAddress GetTextureAddressV(long Stage) const;
00088
00089
00090
00091 deBoolean SetTextureMinFilter(long Stage, TextureFilter Filter);
00092 deBoolean SetTextureMagFilter(long Stage, TextureFilter Filter);
00093 deBoolean SetTextureMipFilter(long Stage, TextureFilter Filter);
00094 TextureFilter GetTextureMinFilter(long Stage) const;
00095 TextureFilter GetTextureMagFilter(long Stage) const;
00096 TextureFilter GetTextureMipFilter(long Stage) const;
00097
00098 deBoolean SetTexCoordSource(long Stage, long SourceStage);
00099 deBoolean SetTexCoordGen(long Stage, TextureCoordSource SourcePipe, long CopyWrapModeStage);
00100 deBoolean GetTexCoordSource(long Stage, long &SourceStage, TextureCoordSource &SourceFlags);
00101 long GetTexCoordSourceCombined(long Stage);
00102
00103 deBoolean SetTextureProjection(long Stage, deBoolean Enable);
00104 deBoolean GetTextureProjection(long Stage);
00105
00106 deBoolean CopyStageSettings(IdeRenderTexture* Target, long SourceStage, long TargetStage) const;
00107
00108 private:
00109 deBoolean m_EnableMipMaps;
00110 deBoolean m_TextureProjection[TEXTURESTAGE_COUNT];
00111 TextureArg m_ColorArgs[TEXTURESTAGE_COUNT][4];
00112 TextureArg m_AlphaArgs[TEXTURESTAGE_COUNT][3];
00113 TextureOp m_ColorOperation[TEXTURESTAGE_COUNT];
00114 TextureOp m_AlphaOperation[TEXTURESTAGE_COUNT];
00115 IdeBitmapProxy* m_Bitmaps[TEXTURESTAGE_COUNT];
00116 TextureAddress m_TextureAddressU[TEXTURESTAGE_COUNT];
00117 TextureAddress m_TextureAddressV[TEXTURESTAGE_COUNT];
00118 TextureFilter m_TextureFilterMin[TEXTURESTAGE_COUNT];
00119 TextureFilter m_TextureFilterMag[TEXTURESTAGE_COUNT];
00120 TextureFilter m_TextureFilterMip[TEXTURESTAGE_COUNT];
00121 long m_TexCoordSource[TEXTURESTAGE_COUNT];
00122 deIDPair m_CachedBitmapIDs[TEXTURESTAGE_COUNT];
00123
00124 static TextureFilter DefaultMinFilter, DefaultMagFilter, DefaultMipFilter;
00125 static deBoolean DefaultToMip;
00126 };
00127
00128
00129 class deRenderMaterial : public deRenderState, public IdeRenderMaterial
00130 {
00131
00132 protected:
00133 ~deRenderMaterial();
00134 public:
00135 deRenderMaterial();
00136
00137 IdeRenderState::Type GetRSType() const;
00138 void * GetRSInterface(IdeRenderState::Type type) const;
00139 WorldObjectClassDef;
00140
00141
00142 deBoolean SetAmbientColor(deColor *AmbientColor);
00143 deBoolean GetAmbientColor(deColor *AmbientColor) const;
00144
00145 deBoolean SetDiffuseColor(deColor *DiffuseColor);
00146 deBoolean GetDiffuseColor(deColor *DiffuseColor) const;
00147
00148 deBoolean SetSpecularColor(deColor *SpecularColor);
00149 deBoolean GetSpecularColor(deColor *SpecularColor) const;
00150
00151 deBoolean SetEmissiveColor(deColor *EmissiveColor);
00152 deBoolean GetEmissiveColor(deColor *EmissiveColor) const;
00153
00154
00155 deBoolean SetAmbientSource(MatSource_t Source);
00156 MatSource_t GetAmbientSource() const;
00157
00158 deBoolean SetDiffuseSource(MatSource_t Source);
00159 MatSource_t GetDiffuseSource() const;
00160
00161 deBoolean SetSpecularSource(MatSource_t Source);
00162 MatSource_t GetSpecularSource() const;
00163
00164 deBoolean SetEmissiveSource(MatSource_t Source);
00165 MatSource_t GetEmissiveSource() const;
00166
00167
00168 deBoolean SetSpecularPower(float Power);
00169 float GetSpecularPower() const;
00170
00171 const MatData* GetAllData() const;
00172 deBoolean SetAllData(const MatData* Data);
00173
00174 private:
00175 MatData m_Data;
00176 };
00177
00178
00179 class deRenderLight : public deRenderState, public IdeRenderLight
00180 {
00181
00182 protected:
00183 ~deRenderLight();
00184 public:
00185 deRenderLight();
00186
00187 IdeRenderState::Type GetRSType() const;
00188 void * GetRSInterface(IdeRenderState::Type type) const;
00189 WorldObjectClassDef;
00190
00191
00192 deBoolean SetLightType(LightType_t Type);
00193 LightType_t GetLightType() const;
00194
00195
00196 deBoolean SetAmbientColor(deColor *AmbientColor);
00197 deBoolean GetAmbientColor(deColor *AmbientColor) const;
00198
00199 deBoolean SetDiffuseColor(deColor *DiffuseColor);
00200 deBoolean GetDiffuseColor(deColor *DiffuseColor) const;
00201
00202 deBoolean SetSpecularColor(deColor *SpecularColor);
00203 deBoolean GetSpecularColor(deColor *SpecularColor) const;
00204
00205
00206 deBoolean SetPosition(deVertex *Position);
00207 deBoolean GetPosition(deVertex *Position) const;
00208
00209 deBoolean SetDirection(deVertex *Direction);
00210 deBoolean GetDirection(deVertex *Direction) const;
00211
00212
00213 deBoolean SetRange(float MaxRange);
00214 float GetRange() const;
00215
00216 deBoolean SetFallOff(float FallOff);
00217 float GetFallOff() const;
00218
00219 deBoolean SetAttenuation(long Number, float Value);
00220 float GetAttenuation(long Number) const;
00221
00222 deBoolean SetTheta(float Theta);
00223 float GetTheta() const;
00224
00225 deBoolean SetPhi(float Phi);
00226 float GetPhi() const;
00227
00228
00229 deBoolean SetID(long Number);
00230 long GetID() const;
00231
00232
00233 deBoolean SetStatus(deBoolean On);
00234 deBoolean GetStatus() const;
00235
00236 const LightData* GetAllData() const;
00237 deBoolean SetAllData(const LightData* Data);
00238
00239 private:
00240 LightData m_Data;
00241 };
00242
00243 #endif